{template "mheader.html"}

<div class="portlet light ">
    <div class="portlet-title tabbable-line">
        <div class="caption">
        <span class="caption-subject ">我的订单</span>
    </div>
    </div>
    <div class="portlet-body">
        <div class="table-scrollable">
            <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                <thead>
                <tr class="heading">
                    <th style="text-align:center" width="90" class="{dr_sorting('catid')}" name="catid">类型</th>
                    <th width="120" class="{dr_sorting('inputtime')}" name="inputtime">购买时间</th>
                    <th width="120" class="{dr_sorting('endtime')}" name="endtime">到期时间</th>
                    <th class="{dr_sorting('title')}" name="title">商品名称</th>
                    <th width="120" class="{dr_sorting('price')}" name="price">付款金额</th>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                {loop $list $t}
                <tr class="odd gradeX" id="dr_row_{$t.id}">
                    <td style="text-align:center">{php echo dr_cat_value('cloud', $t.catid, 'name')}</td>
                    <td>{dr_date($t.inputtime, 'Y-m-d')}</td>
                    <td>{dr_date($t.endtime, 'Y-m-d')}</td>
                    <td><a href="{$t.url}" target="_blank">{dr_strcut($t.title, 30)}</a></td>
                    <td>{dr_price_value($t.price)}</td>
                    <td>
                        {if -1 == $t.status}
                        <label><a href="/index.php?s=cloud&c=buy&m=pay&id={$t.id}" target="_blank" class="btn btn-xs red"> 未付款 </a></label>
                        {elseif !$t.status}
                        <label><a class="btn btn-xs red"> 请等待开通 </a></label>
                        {/if}
                        {if $t.status > 0 && dr_is_down_shop($t.catid)}
                        <label><a href="/index.php?s=cloud&c=down&id={$t.cid}" target="_blank" class="btn btn-xs blue"> 离线下载 </a></label>
                        {/if}
                        <label><a href="{dr_member_url('cloud/my/show', ['id'=>$t.id])}" class="btn btn-xs green"> 订单明细 </a></label>
                        {if $app_config['cloud']['catid'][58] == $t.catid && dr_is_app('xcx')}
                        <label><a href="{dr_member_url('xcx/admin/order', ['id'=>$t.id])}" class="btn btn-xs red" target="_blank"> <i class="fa fa-user"></i> {dr_lang('管理小程序')}</a></label>
                        {/if}
                    </td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>

        {if $mypages}
        <div class="fc-pages text-center">{$mypages}</div>
        {/if}
    </div>
</div>

<script>
    function dr_ajax_dz_url(url) {
        var index = layer.load(2, {
            shade: [0.3,'#fff'], //0.1透明度的白色背景
            time: 100000000
        });
        $.ajax({
            type: "GET",
            url: url,
            dataType: "json",
            success: function (json) {
                layer.close(index);
                dr_tips(json.code, json.msg);
                if (json.code) {
                    if (json.data.url) {
                        setTimeout("window.location.href = '"+json.data.url+"'", 2000);
                    }
                }
            },
            error: function(HttpRequest, ajaxOptions, thrownError) {
                dr_ajax_alert_error(HttpRequest, ajaxOptions, thrownError)
            }
        });
    }
</script>

{template "mfooter.html"}